#include "stdafx.h"
#include "GameResources.h"


CGameResources::CGameResources()
{
}


CGameResources::~CGameResources()
{
}


void CGameResources::InitGameResources()
{
	char filename[40];
	for (int i = 0; i < MARIOIMAGE_COUNT; i++) {
		sprintf_s(filename,"./pic/mario/%d.jpg",i+1);
		MarioImage[i] = cvLoadImage(filename);
	}
	for (int i = 0; i < MAX_MAPIMAGE_COUNT; i++) {
		sprintf_s(filename, "./pic/wall/%d.jpg", i);
		m_MapElementImage[i] = cvLoadImage(filename);
	}
}


void CGameResources::ReleaseGameResources()
{
	for (int i = 0; i < MARIOIMAGE_COUNT; i++) {
		cvReleaseImage((MarioImage + i));
	}
	for (int i = 0; i < MAX_MAPIMAGE_COUNT; i++) {
		cvReleaseImage((m_MapElementImage + i));
	}
}
